package al.xc.common.exception;

import al.xc.common.slefenum.CodeEnum;

/**
 * 错误类型枚举
 */
public enum ResultCodeDefine implements CodeEnum {

    OK(0, "成功"),
    FAIL(-1, "失败"),
    ERROR_TOKEN(20, "Token无效"),
    ERROR_RECALL(102, "请勿频繁提交"),
    EXCEPTION(501, "异常"),
    DECODE_EXCEPTION(502, "解码错误");

    /**
     * 构造
     * @param code
     * @param description
     */
    ResultCodeDefine(int code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * 错误码
     */
    private int code;
    /**
     * 错误描述
     */
    private String description;

    /**
     * 获取错误码
     * @return
     */
    public int getCode() {
        return code;
    }

    /**
     * 获取错误描述
     * @return
     */
    public String getDescription() {
        return description;
    }

}
